<html>
<head>
	<title>SQL Relay Configuration Reference</title>
	<link rel="stylesheet" href="../css/styles.css">
</head>
<body>
<h1>SQL Relay Configuration Reference</h1>

<ul>
  <li><a href="#example">Example</a></li>
  <li><a href="#tags">Tags</a></li>
  <li><a href="#attributes">Attributes</a></li>
</ul>

<a name="example"/><h2>Example</h2>

<p>The SQL Relay configuration file is usually located at /usr/local/firstworks/etc/sqlrelay.conf</p>

<p>Additional configuration files may be created under the configuration directory, usually /usr/local/firstworks/etc/sqlrelay.conf.d</p>

<p>Files in the configuration directory may be given any name, but it is conventional to give them a .conf suffix.</p>

<p>Each configuration file may define any number of SQL Relay instances.</p>

<p>A fairly comprehensive example follows.</p>

<blockquote>
<!-- Generator: GNU source-highlight 3.1.8
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
<pre><tt><b><font color="#000080">&lt;?xml</font></b> <font color="#009900">version</font><font color="#990000">=</font><font color="#FF0000">"1.0"</font><b><font color="#000080">?&gt;</font></b>
<b><font color="#0000FF">&lt;instances&gt;</font></b>

	<b><font color="#0000FF">&lt;instance</font></b> <font color="#009900">id</font><font color="#990000">=</font><font color="#FF0000">"example"</font> <font color="#009900">enabled</font><font color="#990000">=</font><font color="#FF0000">"yes"</font> <font color="#009900">dbase</font><font color="#990000">=</font><font color="#FF0000">"oracle"</font>
		<font color="#009900">port</font><font color="#990000">=</font><font color="#FF0000">"9000"</font> <font color="#009900">socket</font><font color="#990000">=</font><font color="#FF0000">"/tmp/example.socket"</font>
		<font color="#009900">connections</font><font color="#990000">=</font><font color="#FF0000">"3"</font> <font color="#009900">maxconnections</font><font color="#990000">=</font><font color="#FF0000">"15"</font> <font color="#009900">maxqueuelength</font><font color="#990000">=</font><font color="#FF0000">"5"</font> <font color="#009900">growby</font><font color="#990000">=</font><font color="#FF0000">"1"</font> <font color="#009900">ttl</font><font color="#990000">=</font><font color="#FF0000">"60"</font> <font color="#009900">softttl</font><font color="#990000">=</font><font color="#FF0000">"0"</font>
		<font color="#009900">maxsessioncount</font><font color="#990000">=</font><font color="#FF0000">"1000"</font> <font color="#009900">endofsession</font><font color="#990000">=</font><font color="#FF0000">"commit"</font> <font color="#009900">sessiontimeout</font><font color="#990000">=</font><font color="#FF0000">"600"</font>
		<font color="#009900">runasuser</font><font color="#990000">=</font><font color="#FF0000">"nobody"</font> <font color="#009900">runasgroup</font><font color="#990000">=</font><font color="#FF0000">"nobody"</font> <font color="#009900">cursors</font><font color="#990000">=</font><font color="#FF0000">"5"</font> <font color="#009900">maxcursors</font><font color="#990000">=</font><font color="#FF0000">"10"</font> <font color="#009900">cursors_growby</font><font color="#990000">=</font><font color="#FF0000">"1"</font>
		<font color="#009900">authtier</font><font color="#990000">=</font><font color="#FF0000">"connection"</font> <font color="#009900">sessionhandler</font><font color="#990000">=</font><font color="#FF0000">"process"</font> <font color="#009900">handoff</font><font color="#990000">=</font><font color="#FF0000">"pass"</font> <font color="#009900">deniedips</font><font color="#990000">=</font><font color="#FF0000">""</font> <font color="#009900">allowedips</font><font color="#990000">=</font><font color="#FF0000">""</font>
		<font color="#009900">maxquerysize</font><font color="#990000">=</font><font color="#FF0000">"65536"</font> <font color="#009900">maxbindvars</font><font color="#990000">=</font><font color="#FF0000">"256"</font> <font color="#009900">maxstringbindvaluelength</font><font color="#990000">=</font><font color="#FF0000">"4000"</font> <font color="#009900">maxlobbindvaluelength</font><font color="#990000">=</font><font color="#FF0000">"71680"</font>
		<font color="#009900">idleclienttimeout</font><font color="#990000">=</font><font color="#FF0000">"-1"</font> <font color="#009900">maxlisteners</font><font color="#990000">=</font><font color="#FF0000">"-1"</font> <font color="#009900">listenertimeout</font><font color="#990000">=</font><font color="#FF0000">"0"</font> <font color="#009900">reloginatstart</font><font color="#990000">=</font><font color="#FF0000">"no"</font>
		<font color="#009900">fakeinputbindvariables</font><font color="#990000">=</font><font color="#FF0000">"no"</font> <font color="#009900">translatebindvariables</font><font color="#990000">=</font><font color="#FF0000">"no"</font> <font color="#009900">isolationlevel</font><font color="#990000">=</font><font color="#FF0000">"read committed"</font>
		<font color="#009900">ignoreselectdatabase</font><font color="#990000">=</font><font color="#FF0000">"no"</font> <font color="#009900">waitfordowndatabase</font><font color="#990000">=</font><font color="#FF0000">"yes"</font><b><font color="#0000FF">&gt;</font></b>
	       <b><font color="#0000FF">&lt;users&gt;</font></b>
		      <b><font color="#0000FF">&lt;user</font></b> <font color="#009900">user</font><font color="#990000">=</font><font color="#FF0000">"user1"</font> <font color="#009900">password</font><font color="#990000">=</font><font color="#FF0000">"password1"</font><b><font color="#0000FF">/&gt;</font></b>
		      <b><font color="#0000FF">&lt;user</font></b> <font color="#009900">user</font><font color="#990000">=</font><font color="#FF0000">"user2"</font> <font color="#009900">password</font><font color="#990000">=</font><font color="#FF0000">"password2"</font><b><font color="#0000FF">/&gt;</font></b>
		      <b><font color="#0000FF">&lt;user</font></b> <font color="#009900">user</font><font color="#990000">=</font><font color="#FF0000">"user3"</font> <font color="#009900">password</font><font color="#990000">=</font><font color="#FF0000">"password3"</font><b><font color="#0000FF">/&gt;</font></b>
	       <b><font color="#0000FF">&lt;/users&gt;</font></b>
	       <b><font color="#0000FF">&lt;session&gt;</font></b>
		      <b><font color="#0000FF">&lt;start&gt;</font></b>
			     <b><font color="#0000FF">&lt;runquery&gt;</font></b>alter session set nls_date_format='MM-DD-YYYY HH24:MI:SS'<b><font color="#0000FF">&lt;/runquery&gt;</font></b>
		      <b><font color="#0000FF">&lt;/start&gt;</font></b>
		      <b><font color="#0000FF">&lt;end&gt;</font></b>
			     <b><font color="#0000FF">&lt;runquery&gt;</font></b>alter session set nls_date_format='DD-MON-YYYY'<b><font color="#0000FF">&lt;/runquery&gt;</font></b>
		      <b><font color="#0000FF">&lt;/end&gt;</font></b>
	       <b><font color="#0000FF">&lt;/session&gt;</font></b>
	       <b><font color="#0000FF">&lt;connections&gt;</font></b>
		      <b><font color="#0000FF">&lt;connection</font></b> <font color="#009900">connectionid</font><font color="#990000">=</font><font color="#FF0000">"db1"</font>
			<font color="#009900">string</font><font color="#990000">=</font><font color="#FF0000">"user=exampleuser1;password=examplepassword1;oracle_sid=EXAMPLE1;"</font>
			<font color="#009900">metric</font><font color="#990000">=</font><font color="#FF0000">"1"</font> <font color="#009900">behindloadbalancer</font><font color="#990000">=</font><font color="#FF0000">"no"</font><b><font color="#0000FF">/&gt;</font></b>
		      <b><font color="#0000FF">&lt;connection</font></b> <font color="#009900">connectionid</font><font color="#990000">=</font><font color="#FF0000">"db2"</font>
			<font color="#009900">string</font><font color="#990000">=</font><font color="#FF0000">"user=exampleuser2;password=examplepassword2;oracle_sid=EXAMPLE2;"</font>
			<font color="#009900">metric</font><font color="#990000">=</font><font color="#FF0000">"3"</font> <font color="#009900">behindloadbalancer</font><font color="#990000">=</font><font color="#FF0000">"no"</font><b><font color="#0000FF">/&gt;</font></b>
		      <b><font color="#0000FF">&lt;connection</font></b> <font color="#009900">connectionid</font><font color="#990000">=</font><font color="#FF0000">"db3"</font>
			<font color="#009900">string</font><font color="#990000">=</font><font color="#FF0000">"user=exampleuser3;password=examplepassword3;oracle_sid=EXAMPLE3;"</font>
			<font color="#009900">metric</font><font color="#990000">=</font><font color="#FF0000">"5"</font> <font color="#009900">behindloadbalancer</font><font color="#990000">=</font><font color="#FF0000">"no"</font><b><font color="#0000FF">/&gt;</font></b>
		      <b><font color="#0000FF">&lt;connection</font></b> <font color="#009900">connectionid</font><font color="#990000">=</font><font color="#FF0000">"db4"</font>
			<font color="#009900">string</font><font color="#990000">=</font><font color="#FF0000">"user=exampleuser4;password=examplepassword4;oracle_sid=EXAMPLE4;"</font>
			<font color="#009900">metric</font><font color="#990000">=</font><font color="#FF0000">"6"</font> <font color="#009900">behindloadbalancer</font><font color="#990000">=</font><font color="#FF0000">"no"</font><b><font color="#0000FF">/&gt;</font></b>
	       <b><font color="#0000FF">&lt;/connections&gt;</font></b>
        <b><font color="#0000FF">&lt;/instance&gt;</font></b>

<b><font color="#0000FF">&lt;/instances&gt;</font></b>
</tt></pre>

</blockquote>
<a name="tags"/><h2>Tags</h2>

<ul>
  <li>The <b>instances</b> tag is just the root tag.  Each configuration file should have only one of these tags surrounding all other tags.</li>
  <ul>
    <li>Each <b>instance</b> tag defines an instance of SQL Relay.  You can define as many of these as you like in each configuration file.</li>
    <li>The <b>users</b> tag surrounds the list of users that may connect to the instance.</li>
    <ul>
      <li>Each <b>user</b> tag defines a user/password combination that may be used to connect to the instance.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
    </ul>

    <li>The <b>session</b> tag surrounds a set of queries to be run at the start and end of each session.  The entire <b>session</b> block is optional.</li>
    <ul>
      <li>The <b>start</b> tag surrounds a set of queries to be run at the the start of each session and the <b>end</b> tag surrounds a set of qeries to be run at the end of each session.  Both are optional.</li>
      <ul>
        <li>The <b>runquery</b> tag surrounds a query to be run at the beginning or end of a session.  Any number (including 0) of these may be specified.</li>
      </ul>

    </ul>

    <li>The <b>connections</b> tag surrounds the list of database connection configurations used by the instance.</li>
    <ul>
      <li>Each <b>connection</b> tag defines a database connection configuration.  In most cases, there will be only 1 of these tags.  In cases where clustered or replicated databases are used, there would likely be more than 1 line here.  See <a href="loadbalfailover.html">Load Balancing and Failover</a> for more information.</li>
    </ul>

  </ul>

</ul>

<a name="attributes"/><h2>Attributes</h2>

<p>Below is a description of the attributes for each tag.</p>

<ul>
  <li><b>instance</b></li>
  <ul>
    <li><b>id</b> - The ID of this instance.</li>
    <li><b>enabled</b> - Whether to auto-start this instance.  Defaults to "no".  If set to "yes", then this instance will be started when sqlr-start is run with no arguments (as it is in the init scripts which run at boot).</li>
    <li><b>addresses</b> - A comma-delimited list of addresses that the instance should bind to.  If absent or set to 0.0.0.0, it will bind to all addresses.  Defaults to 0.0.0.0.</li>
    <li><b>port</b> - The port to listen for client connections on (note, if multiple instances are configured with the same port or socket, they cannot be run at the same time).  Defaults to 9000.</li>
    <li><b>socket</b> - The unix socket (filename) to listen for client connections on (note, if multiple instances are configured with the same port or socket, they cannot be run at the same time).  Defaults to /tmp/sqlrelay.socket</li>
    <li>Kerberos options - Use these options to configure Kerberos encryption and authentication.</li>
    <ul>
      <li><b>krb</b> - Set to "yes" to enable Kerberos encryption and authentication.  Set to "no" to disable Kerberos encryption and authentication.  Defaults to "no".</li>
      <li><b>krbservice</b> - Specifies the kerberos service to run this instance as.  Defaults to "sqlrelay".</li>
      <li><b>krbkeytab</b> - Sets the Kerberos keytab file to acquire the service key from.  Defaults to the system keytab, usually /etc/krb.keytab.  Has no effect on Windows systems.</li>
      <li><b>krbmech</b> - Sets the Kerberos mechanism to use.  On Linux and Unix systems this should ba an OID, like: "{ 1 2 840 113554 1 2 2 }".  On Windows systems this should be the string name of the mechanism, like: "Kerberos".  Defaults to the default mechanism of the Kerberos implementation.  Only set this if you know that you have a good reason to.</li>
      <li><b>krbflags</b> - Sets the Kerberos flags to use.  Multiple flags may be specified, separated by commas.  Valid flags include: GSS_C_MUTUAL_FLAG, GSS_C_REPLAY_FLAG, GSS_C_SEQUENCE_FLAG, GSS_C_CONF_FLAG, and GSS_C_INTEG_FLAG.  For a full list of flags, consult the GSSAPI documentation, though note that only the previously listed flags are supported on Windows.  Only set this if you know that you have a good reason to.</li>
    </ul>

    <li>TLS/SSL options - Use these options to configure TLS/SSL encryption and authentication.</li>
    <ul>
      <li><b>tls</b> - Set to "yes" to enable TLS/SSL encryption and authentication.  Set to "no" to disable TLS/SSL encryption and authentication.  Defaults to "no".</li>
      <li><b>tlsversion</b> - Sets the TLS/SSL version to use.  Valid values include SSL2, SSL3, TLS1, TLS1.1, TLS1.2 or any more recent version of TLS, as supported by and enabled in the underlying TLS/SSL library.  If left blank or omitted, the highest supported version will be negotiated.</li>
      <li><b>tlscert</b> - Specifies the TLS/SSL certificate chain to use.  On non-Windows platforms, it must specify a certificate chain file.  On Windows platforms it may specify a certificate chain file or a certificate in a Windows Certificate Store.  (See <a href="tlscert.html">The tlscert Parameter</a> for more information.)</li>
      <li><b>tlspassword</b> - Specifies the password to use if the certificate contains a password-protected private key.</li>
      <li><b>tlsvalidate</b> - Set to "yes" to instruct the server to request a certificate from the client and only allow a session to proceed if it can be validatated against known certificate authorities, including any supplied by the tlsca parameter.  Set to "no" not to request a certificate from the client.  Defaults to "no.</li>
      <li><b>tlsca</b> - Specifies the location of a certificate store containing the certificate of the certificate authority to use, in addition to the system's root certificates, when validating the client's certificate.  This is useful if the client's certificate is self-signed, or signed in-house.  On non-Windows platforms, this parameter can be either a certificate store file or the name of a directory containing multiple certificate store files.  On Windows platforms it may specify a certificate store file or a Windows Certificate Store.  (See <a href="tlsca.html">The tlsca Parameter</a> for more information.)</li>
      <li><b>tlsciphers</b> - Specifies a list of ciphers to allow.  Ciphers may be separated by spaces, commas, or colons.  If omitted or left empty then a default set of ciphers is used.  For a list of valid ciphers on Linux/Unix platforms, see: man ciphers.  For a list of valid ciphers on Windows platforms, see: <a target="_blank" href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa375549%28v=vs.85%29.aspx">this link</a>.  On Windows platforms, the ciphers (alg_id's) should omit CALG_ and may be given with underscores or dashes. For example: 3DES_112.  Only set this if you know that you have a good reason to.</li>
      <li><b>tlsdepth</b> - Sets the maximum certificate chain validation depth.  The absolute maximum depth is 9.  Defaults to "9".</li>
    </ul>

    <li><b>dbase</b> - The type of database the connection daemon should connect to.  Should be one of: "oracle", "freetds", "sap", "db2", "informix", "mysql", "postgresql", "firebird", "sqlite", odbc", or "mdbtools".  Defaults to "oracle".  Note: for historical reasons, "oracle8" and "sybase" are also supported, and are synonymous with "oracle" and "sap"</li>
    <li><b>connections</b> - The number of database connections to open at startup.  This may be set to any positive number or 0.  Defaults to 5.  (Note: implicitly limited to a compile time limit, which is configurable, but defaults to 4096.)</li>
    <li><b>maxconnections</b> - The maximum number of database connections to scale up to.  If this is set to a number lower than the value for the <b>connections</b> parameter then it will be automatically bumped up to the value set for <b>connections</b>.  Defaults to the same value as <b>connections</b>.  (Note: implicitly limited to a compile time limit, which is configurable, but defaults to 4096.)</li>
    <li><b>maxqueuelength</b> - The size the queue of waiting clients has to grow to before more connections will be spawned.  Defaults to 0.</li>
    <li><b>growby</b> - The number of connections that will be started at a time when new connections are spawned.  Defaults to 1.</li>
    <li><b>ttl</b> - The number of seconds that a dynamically spawned connection will sit idle, waiting for a client, before giving up and shutting down.  Setting this parameter to 0 causes each dynamically spawned connection to die immediately after handling one client session.  Defaults to 60 (one minute).</li>
    <li><b>softttl</b> - The total number of seconds that a dynamically spawned connection intends to live.  When the connection notices that it has been alive for this number of seconds, it voluntarily shuts down, but it only checks after each client session.  Thus, the connection will ignore this parameter until it has handled at least one client session, and it could live longer than this time if a client session takes a long time, or if it sits idle for a long time between client sessions.  Setting this parameter to 0 disables it.  Defaults to 0 (disabled).</li>
    <li><b>maxsessioncount</b> - The number of client sessions that a dynmically spawned connection will handle before voluntarily shutting down.  Setting this to 0 disables it.  Defaults to 0 (disabled).</li>
    <li><b>endofsession</b> - The command to issue when a client ends its session or dies.  Should be either "commit" or "rollback".  Defaults to "commit".</li>
    <li><b>sessiontimeout</b> - If a client leaves a session open for another client to pick up but no client picks it up, the session will time out after this number of seconds.  Defaults to 600 (10 minutes).</li>
    <li><b>runasuser</b> - The user to run the instance as.  Note that a configuration file must be readable by this user and the various "run" directories (usually under /usr/local/firstworks/var/run/sqlrelay or /usr/local/firstworks/var/sqlrelay) must be writable by this user.  If this parameter is set to a user other than the user who runs sqlr-start, then unless sqlr-start is run as root, it will not be possible to switch to this user and the following warning will be displayed: <i>Warning: could not change user to <b>user</b>.</i>  Usually defaults to "nobody" when built from source and "sqlrelay" when installed from packages.</li>
    <li><b>runasgroup</b> - The group to run the instance as.  Note that a configuration file must be readable by this group and the various "run" directories (usually under /usr/local/firstworks/var/run/sqlrelay or /usr/local/firstworks/var/sqlrelay) must be writable by this group.  If this parameter is set to a group other than a group that the user who runs sqlr-start belongs to, then unless sqlr-start is run as root, it will not be possible to switch to this group and the following warning will be displayed: <i>Warning: could not change group to <b>group</b>.</i>  Usually defaults to "nobody" when built from source and "sqlrelay" when installed from packages.</li>
    <li><b>cursors</b> - The number of database cursors to open and maintain for each database connection.  More cursors may be opened if needed, but the pool of cursors will shrink back down to this size at the end of each client session.  This may be set to any positive number or 0.  Defaults to 1.</li>
    <li><b>maxcursors</b> - The maximum number of database cursors that may be opened for a single client session.  If this is set to a number lower than the value for the <b>cursors</b> parameter then it will be automatically bumped up to the value set for <b>cursors</b>.  Defaults to 5, or the same value as <b>cursors</b>, whichever is greater.</li>
    <li><b>cursors_growby</b> - The number of new cursors that will be opened at a time when new cursors are required.  Defaults to 1.</li>
    <li><b>authtier</b> - Where to authenticate.  Can be set to "connection", "database", or "proxied".  Defaults to connection, which implements <a href="configguide.html#">User List Auth</a>.  See <a href="configguide.html@userlistauth">User List Auth</a>, <a href="configguide.html#dbauth">Database Auth</a> and <a href="configguide.html#proxiedauth">Proxied Auth</a> in the configuration guide for more information.</li>
    <li><b>sessionhandler</b> - Method used by the listener to handle a client session.  Options are either "thread" (the default as of version 0.58) or "process".  When a client connects to the listener, a child is forked to handle the connection.  The child can be either a process or a thread.  Threads should perform better but aren't supported on all platforms.  Defaults to "thread" (as of version 0.58).</li>
    <li><b>handoff</b> - Method for handing off a client from listener to connection, can be one of: "pass" or "proxy".  When an <b>SQL Relay</b> client needs to talk to the database, it connects to a listener process which queues it up until a database connection daemon is available.  When a daemon is available, the client is "handed off" to it.  This "handoff" can be done in one of two ways.  The file descriptor of the connected client can be passed from the listener to the connection daemon, or the listener can proxy the client, ferrying data back and forth between it and the connection daemon.  These two methods are referred to as "pass" and "proxy".  "proxy" works on every platform.  "pass" works on most platforms but not all.  "pass" is faster and lighter than "proxy" and should be used if possible.  Cygwin and Linux kernels prior to 2.2 don't support "pass" though, and on those platforms, even if you specify "pass", "proxy" will be used instead and a warning will be displayed.  Other platforms may not support "pass" as well but those are the only known ones and the only ones where "proxy" is forced.</li>
    <li><b>deinedips</b> - A <a target="_blank" href="http://www.regular-expressions.info">regular expression</a> indicating which IP addresses will be denied access (for example, to deny access to all clients: deniedips=".*")  By default, no IP addresses are denied.</li>
    <li><b>allowedips</b> - A <a target="_blank" href="http://www.regular-expressions.info">regular expression</a> indicating which IP addresses will be allowed access, overriding deniedips (for example, to allow access to clients from the 192.168.2.0 and 64.45.22.0 networks: allowedips="(192\.168\.2\..*|64\.45\.22\..*)")  By default, all IP addresses are allowed.</li>
    <li><b>maxquerysize</b> - Sets the maximum query length (in bytes) that the SQL Relay server will accept, if a client tries to send a longer query, the server will close the connection.  Defaults to 65536 (64k) bytes.</li>
    <li><b>maxbindvars</b> - Sets the maximum number of input and output bind variables that the server will accept in a single query, if a client tries to send more input bind variables or more output bind variables than this number, in a single query, the server will close the connection.  Defaults to 256 bind variables.  Note that this parameter controls both input and output bind variables independently.  For example, setting it to 512 would allow both 512 input bind variables and 512 output bind variables.</li>
    <li><b>maxstringbindvaluelength</b> - Sets the maximum length of a string bind value that the SQL Relay server will accept, if the client tries to send a longer string bind value, the server will close the connection.  Defaults to 32768 (32k) bytes.</li>
    <li><b>maxlobbindvaluelength</b> - Sets the maximum length of a LOB/CLOB bind value that the SQL Relay server will accept, if the client tries to send a longer LOB/CLOB bind value, the server will close the connection.  Defaults to 71680 (70k) bytes.</li>
    <li><b>idleclienttimeout</b> - Sets the number of seconds that a client can sit idle while logged into the SQL Relay server before it will be disconnected.  Defaults to -1, which means to wait forever.</li>
    <li><b>maxlisteners</b> - When a client connects to the listener but no connections are available, a child listener is forked off to wait for an available connection.  Since these can pile up and consume system resources, this parameter allows you to limit the number of child listeners that can be running simultaneously before an error will be returned to the client.  Defaults to -1, which means to run without a limit.</li>
    <li><b>listenertimeout</b> - Sets the number of seconds that a listener will wait for an avaialable connection before giving up.  Defaults to 0, which means to wait forever.</li>
    <li><b>reloginatstart</b> - When SQL Relay starts up, it attempts to log into the database.  If this parameter is set to yes, then if the login fails, SQL Relay will fork off into the background and attempt to log in over and until it succeeds or until it is shut down.  If this parameter is set to no, then if the login fails, SQL Relay will print out an error and exit.  This parameter is useful in situations where it is difficult or impossible to guarantee that SQL Relay will start after the databases it needs to connect to are up.  Defaults to "no".</li>
    <li><b>fakeinputbindvariables</b> - Instead of binding variables using the native database API, SQL Relay can fake input bind variables by rewriting the query and substituting values directly into it.  Setting this parameter to "yes" enables this functionality.  This is useful if you are using an old version of a database that doesn't support bind variables natively or if your are using a modern version but your app was originally written when the database didn't support bind variables natively or when SQL Relay didn't support native bind variables with that database.  If enabled, bind variables must be specified in the query as a colon, followed by a name or number (eg.  :var1 or :1) unless the translatebindvariables parameter is also set to "yes".  Defaults to "no".</li>
    <li><b>translatebindvariables</b> - There is no standaradized format for bind variables across databases.  Some databases use question marks to identify bind variables, others use colon, dollar-sign or at-signs, followed by either names or numbers.  Setting this parameter to "yes" causes SQL Relay to remap the bind variables in a query to the native format for whatever database the query is being run against.  This is useful when migrating from one database to another or when using fake binds against a database that doesn't support colon-delimited bind variables.  Defaults to "no".</li>
    <li><b>isolationlevel</b> - Sets the transaction isolation level to the specified value.  At the end of each client session, the isolation level will be reset to this value as well.  If this is left blank or omitted entirely then nothing will be done to set or reset the isolation level at the beginning or end of each session.</li>
    <li><b>ignoreselectdatabase</b> - Instructs SQL Relay to ignore selectDatabase() calls from the client.  If you want to point an instance at a test database and a program at the instance but the program manually selects the database to use, effectively aiming itself back at production, this is useful in preventing it from doing so.  Defaults to "no".</li>
    <li><b>waitfordowndatabase</b> - If this is set to "yes" then, if the database goes down while a client is connected, the server will not return an error but rather wait until the database comes back up and then resume the client session.  If this is set to "no" and a down database is detected during a client session, then SQL Relay will return the native database error and if a new client connection is made and all databases are down then SQL Relay will generate an error and return it.  Defaults to "yes".</li>
    <li><b>datetimeformat</b> - Date/time formats vary widely between databases.  Some databases allow you to define what format to return the date/time in.  Others do not.  This can be be especially problematic when switching an app from using one database to using another.  If datetimeformat is set to some value, SQL Relay will attempt to detect a date/time field in the result set and reformat it into the supplied format.  SQL Relay can detect a wide variety of date formats but is admittedly imperfect.  Format strings can use any combination of the following format characters.  Non-format characters will be inserted as-is.</li>
    <ul>
      <li><b>DD</b> - day of the month</li>
      <li><b>MM</b> - numeric month</li>
      <li><b>MON</b> - 3-character text abbreviation for the month</li>
      <li><b>Month</b> - full text month</li>
      <li><b>YYYY</b> - year including century</li>
      <li><b>YY</b> - year excluding century</li>
      <li><b>HH24</b> - hour (0-23)</li>
      <li><b>HH</b> - hour (1-12)</li>
      <li><b>MI</b> - minute</li>
      <li><b>SS</b> - second</li>
      <li><b>FFF</b> - fraction of a second</li>
      <li><b>AM</b> - AM or PM</li>
    </ul>

    <li><b>dateformat</b> - Similar to datetimeformat but if a date without the time component is detected, the supplied format will be used instead of the format supplied in the datetimeformat parameter.  Defaults to whatever value was supplied in the datetimeformat parameter.</li>
    <li><b>timeformat</b> - Similar to datetimeformat but if a time without the date component is detected, the supplied format will be used instead of the format supplied in the datetimeformat parameter.  Defaults to whatever value was supplied in the datetimeformat parameter.</li>
    <li><b>dateddmm</b> and <b>dateyyyyddmm</b> - When date/time translation is enabled (one or more of datetimeformat, dateformat or timeformat are set), the server attempts to interpret each field in the result set as a date/time to determine whether it needs to be translated or not.  It can parse the native formats of all the databases that SQL Relay currently supports, but it cannot tell by examination whether a date like 02-05-2011 is in MM-DD-YYYY format or DD-MM-YYYY format.  By default, it assumes MMDD, but if you want it to assume DDMM instead, set <b>dateddmm</b> to "yes".  Another parameter allows you to specify different behaviors for dates that start with years, such as 2011-02-05.  If <b>dateyyyyddmm</b> is set to "yes" then that date would be interpreted as being in the YYYY-DD-MM format.  If it is set to "no" then that date would be interpreted as being in the YYYY-MM-DD format.  If it is not set, then it defaults to whatever <b>dateddmm</b> is set to.  If neither are set then dates are universally interpreted to be in MM/DD format.  There are very specific cases where these two parameters need to be set differently from one another.  You'll know if you need to.  Note: date/time translation in general is especially problematic with MS SQL Server.  See <a href="../faq/#mssqldates">the FAQ</a> for more info.</li>
    <li><b>datedelimiters</b> - When date/time translation is enabled (one or more of datetimeformat, dateformat or timeformat are set), the server attempts to interpret each field in the result set as a date/time to determine whether it needs to be translated or not.  Different cultures and systems delimit dates with different characteres, including slashes, dashes, colons and periods.  This parameter enables you to specify which of these to pay attention to.  For example, if your database contains both slash-delimited and dash-delimited dates, but also contains dot-delimited data that could be misinterpreted as a date, then you'd want to set this to "/-".  Defaults to "/-:."  Characters other than slash, dash, colon and dot are ignored.</li>
    <li><b>ignorenondatetime</b> - When date/time translation is enabled (one or more of datetimeformat, dateformat or timeformat are set), the server attempts to interpret each field in the result set as a date/time to determine whether it needs to be translated or not.  If this parameter is set to "yes" then fields with date/time datatypes will be examined.  Char, and varchar fields, for example, will be ignored.</li>
  </ul>

</ul>

<br/><ul>
  <li><b>user</b></li>
  <ul>
    <li><b>user</b> - The user name required to connect to SQL Relay.</li>
    <li><b>password</b> - The password required to connect to SQL Relay.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  </ul>

</ul>

<br/><ul>
  <li><b>connection</b></li>
  <ul>
    <li><b>connectionid</b> - The ID of this connection.  This parameter defaults to <i>id</i>-<i>number</i> where "id" is the id of the instance snd "number" is the index of the connection tag.  It's not necessary to set this parameter if you use sqlr-start.  It's only necessary if you plan on starting the daemons individually and want friendlier connection ids.</li>
    <li><b>metric</b> - A number that influences how many of this connection should be started.  The <b>metric</b> attribute doesn't actually define how many connections are started, the <b>connections</b> attribute of the <b>instance</b> tag defines that.  The <b>metric</b> attribute influences how many of the total connections will be of that connection type.  The higher the metric relative to the other metrics, the more of that connection type will be started.</li>
    <li><b>behindloadbalancer</b> - Can be set to "yes" or "no".  Indicates whether the database is really a pool of databases behind a load balancer or not.  If the database is not a pool of databases behind a load balancer, then when a connection daemon determines that the database has gone down, it will cause all connection daemons connected to that database to log out and re-login.  However, if the database is really a pool of databases behind a load balancer, and a connection daemon determines that the database has gone down, only that connection will log out and re-login as some or all of the remaining connections may not actually be connected to the same physical database machine, but rather to a clone which has not actually gone down.</li>
    <li><b>string</b> - The database connect string the connection daemon should use.  Connect string options vary depending on the database.  See Connect String Options below.</li>
  </ul>

</ul>

<a name="connectstring"/><h3>Connect String Options</h3>

<a name="oracle"/><p>For <b>oracle</b> databases, the connect string syntax is "user=USER;password=PASSWORD;oracle_sid=ORACLE_SID;oracle_home=ORACLE_HOME;nls_lang=NLS_LANG;autocommit=yes/no;fetchatonce=FETCHATONCE;maxselectlistsize=MAXSELECTLISTSIZE;maxitembuffersize=MAXITEMBUFFERSIZE;faketransactionblocks=yes/no;droptemptables=yes/no;globaltemptables=TABLELIST;lastinsertidfunction=LASTINSERTIDFUNCTION;stmtcachesize=0;rejectduplicatebinds=yes/no;disablekeylookup=yes/no;identity=ID"</p>

<ul>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>oracle_sid</b>: Which Oracle SID to use.  Optional if the ORACLE_SID environment variable is set.  Overrides the ORACLE_SID environment variable.  This parameter can either be an SID name corresponding to an entry in the tnsnames.ora file such as:
  <blockquote>
<i>oracle_sid=ora1</i>
  </blockquote>

or a tnsnames-style expression such as:
  <blockquote>
<i>oracle_sid=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ora1)))</i>
  </blockquote>
</li>
  <li><b>oracle_home</b>: The base directory of the Oracle installation to use.  Optional if the ORACLE_HOME environment variable is set.  The SID will be looked up in $ORACLE_HOME/network/admin/tnsnames.ora.  If SQL Relay was built to load the Oracle client libraries at runtime, then the lib subdirectory of this directory will be searched for the client libraries.</li>
  <li><b>nls_lang</b>: The NLS_LANG to use.  Optional if the NLS_LANG environment variable is set.  Overrides the NLS_LANG environment variable.</li>
  <li><b>autocommit</b>: Whether to commit each insert, update or delete immediately or not.  Optional, defaults to no.</li>
  <li><b>fetchatonce</b>: The number of rows that SQL Relay fetches from the database in each round trip.  Defaults to 10. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxselectlistsize</b>: The maximum number of columns that can be fetched in a query.  Defaults to 256.  Setting this parameter to -1 causes result set buffers to be dynamically allocated, allowing any number of columns to be fetched.  Using -1 is flexible and conserves memory but there is a performance penalty.  (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxitembuffersize</b>: The maximum size of a non-lob field.  Non-lob fields longer than this will be truncated.  Defaults to 32768. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>faketransactionblocks</b>: Some databases are in autocommit mode until you explicitly start a transaction with a "start" or "begin" statement.  Oracle is always in a transaction though, unless autocommit is turned on.  Setting this parameter to "yes" causes SQL Relay to put the database in autocommit mode until a "start" or "begin" statement is issued, and then put it back in autocommit mode when a commit or rollback is issued.  In effect, emulating the behavior of databases which require an explicit "start" or "begin".</li>
  <li><b>droptemptables</b>: In most databases, temporary tables are dropped at the end of the client session.  In Oracle however, the rows may be deleted but the table itself remains.  Setting this parameter to "yes" causes any temporary tables that were created during an SQL Relay client session, to be dropped when the session is over, in effect emulating the behavior or other databases.  Note that temporary tables created outside of the session will not be dropped.</li>
  <li><b>globaltemptables</b>: Since SQL Relay doesn't log out of the database at the end of each client session, global temporary tables aren't automatically truncated by the database.  SQL Relay tracks the creation of global temporary tables and truncates any table created during the session, or drops them if droptemptables=yes is configured.  But, SQL Relay isn't aware of tables created outside of the current session, or outside of SQL Relay altogether.  To work around this issue, this parameter can be set to either a comma-separated list of global temporary tables that SQL Relay should truncate at the end of each session.  Alternatively, it can be set to % and SQL Relay will truncate all global temporary tables that it has access to at the end of each session.  If this parameter is omitted, only tables that were created during the session are truncated.  Providing a list of tables performs better but is less flexible than using %.</li>
  <li><b>lastinsertidfunction</b>: Many databases support auto-increment columns (also called serial or identity columns) and after an insert into a table containing one, the id that was generated may be retrieved via some stored procedure call, api call or special variable.  Oracle doesn't support auto-increment columns but they can be simulated using triggers and sequences.  Trigger-sequence packages are often developed when migrating from a database that supports auto-increment columns to Oracle.  When implementing a trigger-sequence package, it is possible to store the value that was most-recently fetched from the sequence in a package-local variable and provide a function to access it.  This parameter allows you to specify that function so that a call to getLastInsertId() by a SQL Relay client will return whatever value is returned by that function.</li>
  <li><b>stmtcachesize</b>: Set the size of the local statement cache.  Using a local statement cache can improve performance significantly.  This parameter defaults to 0, which disables using the cache.  This parameter also has no effect when SQL Relay is compiled against a version of Oracle prior to 9i.  There is one known issue with using the statement cache.  There is either a bug in OCI or a bug in the way SQL Relay uses it.  Running a query that uses a stored procedure that returns a result set in an output bind cursor while using the statement cache causes a segmentation fault in the OCIStmtExecute function.  To prevent this, SQL Relay prevents any attempt to run such a query if stmtcachesize is non-zero.  It is possible to run such queries when stmtcachesize is set to 0 or defaulted to 0 though.</li>
  <li><b>rejectduplicatebinds</b>: Setting this to yes causes SQL Relay to reject queries which contain more than one instance of the same bind variable.  If you're binding by position and using PL/SQL and your query contains duplicate bind variables, it may not work as expected and it might be convenient to just have SQL Relay reject all queries containing duplicate bind variables.  This parameter is defaulted to no.  By default, queries containing duplicate bind variables are not rejected.</li>
  <li><b>disablekeylookup</b>: It is possible to get the list of columns in a table by running "describe table" or "show columns of table like '...'" in sqlrsh, or calling getColumnList() in one of the native API's, or by other methods using non-native API's.  When doing this, whether each column is a primary, unique or foreign key is returned.  Looking up this key information takes a noticeably long time though.  This parameter makes it possible to disable key lookup by setting disablekeylookup=yes.</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="freetds"/><p>For <b>freetds</b> databases, the connect string syntax is "sybase=SYBASE;user=USER;password=PASSWORD;server=SERVER;db=DATABASE;charset=CHARSET;language=LANGUAGE;hostname=HOSTNAME;packetsize=PACKETSIZE;maxselectlistsize=MAXSELECTLISTSIZE;maxitembuffersize=MAXITEMBUFFERSIZE;identity=ID"</p>

<ul>
  <li><b>sybase</b>: The directory containing the "freetds.conf" file.  Optional if the SYBASE environment variable is set.  Overrides the SYBASE environment variable.</li>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>server</b>: The entry in the "interfaces" or "freetds.conf" file which specifies host, port and other database connection parameters.</li>
  <li><b>db</b>: The database to log into.  Required.</li>
  <li><b>charset</b>: The character set to use.  Optional.</li>
  <li><b>language</b>: The language to use.  Optional.</li>
  <li><b>hostname</b>: The host to connect to.  Optional, overrides the host in the "interfaces" or "freetds.conf" file.</li>
  <li><b>packetsize</b>: The packetsize to use.  Optional.</li>
  <li><b>maxselectlistsize</b>: The maximum number of columns that can be fetched in a query.  Defaults to 256.  Setting this parameter to -1 causes result set buffers to be dynamically allocated, allowing any number of columns to be fetched.  Using -1 is flexible and conserves memory but there is a performance penalty.  (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxitembuffersize</b>: The maximum size of a non-lob field.  Non-lob fields longer than this will be truncated.  Defaults to 32768. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="sap"/><p>For <b>sap</b> (or <b>sybase</b>) databases, the connect string syntax is "sybase=SYBASE;lang=LANG;user=USER;password=PASSWORD;server=SERVER;db=DATABASE;charset=CHARSET;language=LANGUAGE;hostname=HOSTNAME;packetsize=PACKETSIZE;fetchatonce=FETCHATONCE;maxselectlistsize=MAXSELECTLISTSIZE;maxitembuffersize=MAXITEMBUFFERSIZE;identity=ID"</p>

<ul>
  <li><b>sybase</b>: The directory containing the "interfaces" file.  Optional if the SYBASE environment variable is set.  Overrides the SYBASE environment variable.  If SQL Relay was built to load the SAP/Sybase libraries at runtime, then the lib subdirectory of this directory will be searched for the SAP/Sybase client libraries.</li>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>server</b>: The entry in the "interfaces" or "freetds.conf" file which specifies host, port and other database connection parameters.</li>
  <li><b>db</b>: The database to log into.  Required.</li>
  <li><b>charset</b>: The character set to translate data coming out of the database into.  Optional.</li>
  <li><b>language</b>: The language to use.  Optional.</li>
  <li><b>hostname</b>: The host to connect to.  Optional, overrides the host in the "interfaces" or "freetds.conf" file.</li>
  <li><b>packetsize</b>: The packetsize to use.  Optional.</li>
  <li><b>fetchatonce</b>: The number of rows that SQL Relay fetches from the database in each round trip.  Defaults to 10. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxselectlistsize</b>: The maximum number of columns that can be fetched in a query.  Defaults to 256.  Setting this parameter to -1 causes result set buffers to be dynamically allocated, allowing any number of columns to be fetched.  Using -1 is flexible and conserves memory but there is a performance penalty.  (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxitembuffersize</b>: The maximum size of a non-lob field.  Non-lob fields longer than this will be truncated.  Defaults to 32768. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="db2"/><p>For <b>db2</b> databases, the connect string syntax is "user=USER;password=PASSWORD;db=DB;autocommit=yes/no;faketransactionblocks=yes/no;timeout=TIMEOUT;fetchatonce=FETCHATONCE;maxselectlistsize=MAXSELECTLISTSIZE;maxitembuffersize=MAXITEMBUFFERSIZE;maxoutlobbindsize=MAXOUTLOBBINDSIZE;identity=ID"</p>

<ul>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>db</b>: The server instance to connect to.</li>
  <li><b>autocommit</b>: Whether to commit each insert, update or delete immediately or not.  Optional, defaults to no.</li>
  <li><b>lang</b>: Sets/overrides the LANG environment variable and by extension, all locale-related variables.  Optional if the LANG environment variable is set.</li>
  <li><b>faketransactionblocks</b>: Some databases are in autocommit mode until you explicitly start a transaction with a "start" or "begin" statement.  DB2 is always in a transaction though, unless autocommit is turned on.  Setting this parameter to "yes" causes SQL Relay to put the database in autocommit mode until a "start" or "begin" statement is issued, and then put it back in autocommit mode when a commit or rollback is issued.  In effect, emulating the behavior of databases which require an explicit "start" or "begin".</li>
  <li><b>timeout</b>: Specifies the number of seconds to wait for a successful connection to the database.  Defaults to 5 seconds if omitted.  Setting a timeout of 0 means to wait forever.</li>
  <li><b>fetchatonce</b>: The number of rows that SQL Relay fetches from the database in each round trip.  Defaults to 10. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxselectlistsize</b>: The maximum number of columns that can be fetched in a query.  Defaults to 256.  Setting this parameter to -1 causes result set buffers to be dynamically allocated, allowing any number of columns to be fetched.  Using -1 is flexible and conserves memory but there is a performance penalty.  (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxitembuffersize</b>: The maximum size of a non-lob field.  Non-lob fields longer than this will be truncated.  Defaults to 32768. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxoutlobbindsize</b>: The maximum size of a lob output bind variable.  Defaults to 2 megabytes.  Has has no effect on lob columns.</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
  <li><b>db2</b>: The base directory of the DB2 installation.  Only used if SQL Relay was built to load the DB2 client libraries at runtime.  Then the lib, lib32, and lib64 subdirectories of this directory will be searched, as appropriate, for the client libraries.</li>
</ul>

<br/><a name="informix"/><p>For <b>informix</b> databases, the connect string syntax is "user=USER;password=PASSWORD;informixdir=INFORMIXDIR;servername=SERVERNAME;db=DB;autocommit=yes/no;faketransactionblocks=yes/no;timeout=TIMEOUT;fetchatonce=FETCHATONCE;maxselectlistsize=MAXSELECTLISTSIZE;maxitembuffersize=MAXITEMBUFFERSIZE;maxoutlobbindsize=MAXOUTLOBBINDSIZE;identity=ID"</p>

<ul>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>informixdir</b>: Specifies the path to the Informix instance that should be used.  This is used for locating the sqlhosts file and other dependencies.  If not specified, this defaults to the value of the INFORMIXDIR environment variable, if set.  If SQL Relay was built to load the Informix client libraries at runtime, then the lib/cli subdirectory of this directory will be searched for the client libraries.</li>
  <li><b>servername</b>: The server to connect to, as defined in sqlhosts.  If not specified, this defaults to the value of the INFORMIXSERVER environment variable, if set.</li>
  <li><b>db</b>: The database instance to connect to, on the specified server.</li>
  <li><b>informixdir</b>: The server instance to connect to.</li>
  <li><b>autocommit</b>: Whether to commit each insert, update or delete immediately or not.  Optional, defaults to no.</li>
  <li><b>lang</b>: Sets/overrides the LANG environment variable and by extension, all locale-related variables.  Optional if the LANG environment variable is set.</li>
  <li><b>faketransactionblocks</b>: Some databases are in autocommit mode until you explicitly start a transaction with a "start" or "begin" statement.  Informix is always in a transaction though, unless autocommit is turned on.  Setting this parameter to "yes" causes SQL Relay to put the database in autocommit mode until a "start" or "begin" statement is issued, and then put it back in autocommit mode when a commit or rollback is issued.  In effect, emulating the behavior of databases which require an explicit "start" or "begin".</li>
  <li><b>timeout</b>: Specifies the number of seconds to wait for a successful connection to the database.  Defaults to 5 seconds if omitted.  Setting a timeout of 0 means to wait forever.</li>
  <li><b>maxselectlistsize</b>: The maximum number of columns that can be fetched in a query.  Defaults to 256.  Setting this parameter to -1 causes result set buffers to be dynamically allocated, allowing any number of columns to be fetched.  Using -1 is flexible and conserves memory but there is a performance penalty.  (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxitembuffersize</b>: The maximum size of a non-lob field.  Non-lob fields longer than this will be truncated.  Defaults to 32768. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxoutlobbindsize</b>: The maximum size of a lob output bind variable.  Defaults to 2 megabytes.  Has has no effect on lob columns.</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="mysql"/><p>For <b>mysql</b> databases, the connect string syntax is "user=USER;password=PASSWORD;db=DB;host=HOST;port=PORT;socket=SOCKET;fakebinds=FAKEBINDS;maxselectlistsize=MAXSELECTLISTSIZE;maxitembuffersize=MAXITEMBUFFERSIZE;charset=CHARSET;sslmode=sslmode;tlsversion=tlsversion;sslkey=keyfile;sslcert=certfile;sslcipher=cipherlist;sslca=cafile;sslcapath=cafilepath;sslcrl=crlfile;sslcrlpath=crlfilepath;foundrows=yes/no;ignorespace=yes/no;identity=ID"</p>

<ul>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>db</b>: The database to log into.  Required.</li>
  <li><b>host</b>: The host to connect to.  Required.</li>
  <li><b>port</b>: The port to connect to on a remote host.  Optional, defaults to 3306.</li>
  <li><b>socket</b>: The unix socket to connect to.  Optional if host and/or port are specified.  Overrides host/port.  host and port are optional if socket is specified.</li>
  <li><b>fakebinds</b>: MySQL versions 4.1.2 and higher support bind variables natively.  Older versions did not and SQL Relay had to substitute the values of bind variables into the query itself (fake binds).  As such, in modern MySQL, bind variables are identified by ?'s in the query, while in old versions, bind variables are identified by :var1, :var2, :var3, etc.  Converting queries and code which was written to use the old syntax to use the modern syntax can be a lot of work, so this parameter is provided to make code which was written to run against old versions of MySQL work against modern MySQL  This parameter may be set to "yes" (meaning allow only old syntax and fake binds) or "no" (meaning only allow modern syntax and use native binds).</li>
  <li><b>maxselectlistsize</b>: The maximum number of columns that can be fetched in a query.  Defaults to 256.  Setting this parameter to -1 causes result set buffers to be dynamically allocated, allowing any number of columns to be fetched.  Using -1 is flexible and conserves memory but there is a performance penalty.  (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxitembuffersize</b>: The maximum size of a non-lob field.  Non-lob fields longer than this will be truncated.  Defaults to 32768. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>charset</b>: The character set to translate data coming out of the database into.  Excluding this parameter causes the data to be translated to whatever character set the MySQL client library was configured to use at compile time, probably latin1.  Setting this to "binary" will cause the data not to be translated at all.  This parameter is only supported when SQL Relay is compiled against version 5.0.7 or newer of the MySQL client library.</li>
  <li><b>sslmode</b>: The ssl mode of the connection.  Optional.  Valid values include disable, prefer, require, verify-ca (validate the server's certificate) and verify-full (validate the server's certificate and common name).  Defaults to prefer with modern versions of MySQL and disable with older versions.  Ignored when SQL Relay was compiled against MySQL < 5.7.3.  Only necessary when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a>.</li>
  <li><b>tlsversion</b> - Sets the TLS version to use.  Valid values include TLSv1, TLSv1.1, TLSv1.2 or any more recent version of TLS, as supported by and enabled in the underlying MySQL client/server.  Ignored when SQL Relay was compiled against MySQL < 5.7.10.  In that case, or if the parameter is left blank or omitted, then the highest supported version will be negotiated.  Only necessary when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a>.</li>
  <li><b>sslkey</b>: The full path name of the ssl key file. (eg. /etc/certs/key.pem) Only necessary when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a>.</li>
  <li><b>sslcert</b>: The full path name of the ssl certificate file (eg. /etc/certs/cert.pem)  Only necessary when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a>.</li>
  <li><b>sslcipher</b>: The list of permissable ciphers to use for SSL encryption.  Only necessary if you want to restrict which cipers to use when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a>.</li>
  <li><b>sslca</b>: The full path name of an SSL CA certificate to add to the list of trusted CA certificates to validate the host's certificate against. (eg. /etc/certs/ca.pem)  Only necessary when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a>, and then usually only when the host certificate is self-signed.</li>
  <li><b>sslcapath</b>: The full path name to a directory that contains a set of trusted SSL CA certificates to add to the list of trusted CA certificates to validate the host's certificate against. (eg. /etc/certs/ca)  Only necessary when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a>, and then usually only when the host certificate is self-signed.</li>
  <li><b>sslcrl</b>: The full path name of an SSL certificate revocation list.  (eg. /etc/certs/crl.pem)  Only used when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a> and then only when certificate signing authorities which may have signed the server's certificate may have been compromised.</li>
  <li><b>sslcrlpath</b>: The full path name of a directory that contains a set of SSL certificate revocation lists.  (eg. /etc/certs/crl)  Only used when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a> and then only when certificate signing authorities which may have signed the server's certificate may have been compromised.</li>
  <li><b>sslcrlpath</b>: The full path name to a directory that contains a set of trusted SSL CA certificates to add to the list of trusted CA certificates to validate the host's certificate against. (eg. /etc/certs/ca)  Only necessary when <a target="_blank" href="http://dev.mysql.com/doc/refman/5.7/en/using-secure-connections.html">connecting to MySQL using SSL</a>, and then usually only when the host certificate is self-signed.</li>
  <li><b>foundrows</b>: Ordinarily, the MySQL client library returns the number of rows that were modified by an insert, update or delete command are returned as the "affected rows" of the query.  Setting foundrows to "yes" passes a flag to the MySQL client library, telling it to return the number of rows that matched the where clause of the query rather than the number that were modified.  This can be a different number with certain queries.  This parameter defaults to no.</li>
  <li><b>ignorespace</b>: Tells MySQL to allow spaces after function names.  Ie. "select count (*) from mytable" should be valid, with the space between count and (*).</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="postgresql"/><p>For <b>postgresql</b> databases, the connect string syntax is "user=USER;password=PASSWORD;db=DB;host=HOST;port=PORT;sslmode=SSLMODE;options=OPTIONS;typemangling=MANGLING;fakebinds=FAKEBINDS;charset=CHARSET;lastinsertidfunction=LASTINSERTDFUNCTION;identity=ID"</p>

<ul>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>db</b>: The database to log into.  Required.</li>
  <li><b>host</b>: The host to connect to.  Required.  If host begins with a slash (/) then it is assumed to be the directory containing a unix socket starting with .s.PGSQL.</li>
  <li><b>port</b>: The port to connect to on a remote host.  Optional, defaults to 5432.  If host refers to a unix socket, then port is the extension on the socket name (eg. /tmp/.s.PGSQL.5432).</li>
  <li><b>sslmode</b>: The ssl mode of the connection.  Optional, defaults to disable (ie. not to use ssl).  Valid values include disable, allow, prefer, require, verify-ca and verify-full.  See <a target="_blank" href="http://www.postgresql.org/docs/devel/static/libpq-ssl.html#LIBPQ-SSL-SSLMODE-STATEMENTS">SSL Mode Descriptions</a> for more information.  If a mode other than disable is used, certificate and key files must be present in ~/.postgresql (in the home directory of the user that sqlrelay is running as).  See <a target="_blank" href="http://www.postgresql.org/docs/devel/static/libpq-ssl.html#LIBPQ-SSL-FILE-USAGE">SSL Client File Usage</a> for more information.</li>
  <li><b>options</b>: Command line options to be sent to the server.  Optional.</li>
  <li><b>typemangling</b>: If set to "yes" then column types are translated to standard types.  If set to "lookup" then the pg_type table is queried at startup and column type names are returned as they appear in that table.  By default (or if set to "no"), the type number is returned.</li>
  <li><b>fakebinds</b>: Postgresql 8 supports bind variables natively.  Versions prior to 8 did not, and SQL Relay had to substitute the values of bind variables into the query itself (fake binds).  In Postgresql 8, bind variables are identified by $1, $2, $3, etc. in the query, while in versions prior to 8, bind variables are identified by :var1, :var2, :var3, etc.  Converting queries and code which was written to use Postgresql 7 syntax to use Postgresql 8 syntax can be a lot of work, so this parameter is provided to make code which was written to run against Postgresql 7 work against Postgresql 8.  This parameter may be set to "yes" (meaning allow only Postgresql 7 syntax and fake binds) or "no" (meaning only allow Postgresql 8 syntax and use native binds).</li>
  <li><b>charset</b>: The character set to translate data coming out of the database into.  Optional.</li>
  <li><b>lastinsertidfunction</b>: Many databases support auto-increment columns (also called serial or identity columns) and after an insert into a table containing one, the id that was generated may be retrieved via some stored procedure call, api call or special variable.  Postgresql doesn't support auto-increment columns but they can be simulated using triggers and sequences.  Trigger-sequence packages are often developed when migrating from a database that supports auto-increment columns to Postgresql.  When implementing a trigger-sequence package, it is possible to store the value that was most-recently fetched from the sequence in a package-local variable and provide a function to access it.  This parameter allows you to specify that function so that a call to getLastInsertId() by a SQL Relay client will return whatever value is returned by that function.</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="firebird"/><p>For <b>firebird</b> databases, the connect string syntax is "user=USER;password=PASSWORD;db=DATABASE;dialect=DIALECT;autocommit=yes/no;maxselectlistsize=MAXSELECTLISTSIZE;maxitembuffersize=MAXITEMBUFFERSIZE;charset=CHARSET;faketransactionblocks=yes/no;droptemptables=yes/no;globaltemptables=TABLELIST;lastinsertidfunction=LASTINSERTIDFUNCTION;identity=ID"</p>

<ul>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>db</b>: The filename of the database open.  Required.</li>
  <li><b>dialect</b>: The database dialect to use.  Optional, defaults to 3.</li>
  <li><b>autocommit</b>: Whether to commit each insert, update or delete immediately or not.  Optional, defaults to no.</li>
  <li><b>maxselectlistsize</b>: The maximum number of columns that can be fetched in a query.  Defaults to 256.  Setting this parameter to -1 causes result set buffers to be dynamically allocated, allowing any number of columns to be fetched.  Using -1 is flexible and conserves memory but there is a performance penalty.  (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>maxitembuffersize</b>: The maximum size of a non-lob field.  Non-lob fields longer than this will be truncated.  Defaults to 32768. (see <a href="tuning.html#memoryusage">here</a> for more info on this parameter)</li>
  <li><b>charset</b>: The character set to translate data coming out of the database into.  Optional.</li>
  <li><b>faketransactionblocks</b>: Some databases are in autocommit mode until you explicitly start a transaction with a "start" or "begin" statement.  Firebird is always in a transaction though, unless autocommit is turned on.  Setting this parameter to "yes" causes SQL Relay to put the database in autocommit mode until a "start" or "begin" statement is issued, and then put it back in autocommit mode when a commit or rollback is issued.  In effect, emulating the behavior of databases which require an explicit "start" or "begin".</li>
  <li><b>droptemptables</b>: In most databases, temporary tables are dropped at the end of the client session.  In Firebird however, the rows may be deleted but the table itself remains.  Setting this parameter to "yes" causes any temporary tables that were created during an SQL Relay client session, to be dropped when the session is over, in effect emulating the behavior or other databases.  Note that temporary tables created outside of the session will not be dropped.</li>
  <li><b>globaltemptables</b>: Since SQL Relay doesn't log out of the database at the end of each client session, global temporary tables aren't automatically truncated by the database.  SQL Relay tracks the creation of global temporary tables and truncates any table created during the session, or drops them if droptemptables=yes is configured.  But, SQL Relay isn't aware of tables created outside of the current session, or outside of SQL Relay altogether.  To work around this issue, this parameter can be set to either a comma-separated list of global temporary tables that SQL Relay should truncate at the end of each session.  Alternatively, it can be set to % and SQL Relay will truncate all global temporary tables that it has access to at the end of each session.  If this parameter is omitted, only tables that were created during the session are truncated.  Providing a list of tables performs SUBSTANTIALLY better but is less flexible than using %.</li>
  <li><b>lastinsertidfunction</b>: Many databases support auto-increment columns (also called serial or identity columns) and after an insert into a table containing one, the id that was generated may be retrieved via some stored procedure call, api call or special variable.  Firebird doesn't support auto-increment columns but they can be simulated using triggers and sequences.  Trigger-sequence packages are often developed when migrating from a database that supports auto-increment columns to Firebird.  When implementing a trigger-sequence package, it is possible to store the value that was most-recently fetched from the sequence in a package-local variable and provide a function to access it.  This parameter allows you to specify that function so that a call to getLastInsertId() by a SQL Relay client will return whatever value is returned by that function.</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="sqlite"/><p>For <b>sqlite</b> databases, the connect string syntax is "db=DB;identity=ID"</p>

<ul>
  <li><b>db</b>: The filename of the database open.  Required.</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="odbc"/><p>For <b>odbc</b> databases, the connect string syntax is "user=USER;password=PASSWORD;dsn=DSN;autocommit=yes/no;timeout=TIMEOUT;odbcversion=ODBCVERSION;identity=ID"</p>

<ul>
  <li><b>user</b>: The username SQL Relay should use to log into the database.  Required.</li>
  <li><b>password</b>: The password SQL Relay should use to log into the database.  Required.  Required.  The password is generally stored in plain text but it is possible to encrypt the password using a loadable module.  See <a href="configguide.html#pwdenc">Password Encryption</a></li>
  <li><b>dsn</b>: The entry in the the odbcinst.ini which specifies host, port and other database connection parameters.</li>
  <li><b>autocommit</b>: Whether to commit each insert, update or delete immediately or not.  Optional, defaults to no.</li>
  <li><b>timeout</b>: Specifies the number of seconds to wait for a successful connection to the database.  Defaults to 5 seconds if omitted.  Setting a timeout of 0 means to wait forever.</li>
  <li><b>odbcversion</b>: Tells the driver to exhibit behavior from the specified version of ODBC.  Valid values include: 2, 3, and 3.8.  Defaults to 3.  It may be necessary to set this to 2 for some drivers that only support ODBC 2.</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).</li>
</ul>

<br/><a name="mdbtools"/><p>For <b>mdbtools</b> databases, the connect string syntax is "db=DATABASE;identity=ID"</p>

<ul>
  <li><b>db</b>: The filename of the database open.  Required.</li>
  <li><b>identity</b>: Overrides the default value returned when a client request the database identity using the identify() method (or similar method/function).
</li>
</ul>

</body>
</html>
